import { checkUserName,checkPassWord } from "Utils/check";
import imgObj from '@/assets/logo.png'
import axios from 'axios'
import './css/index.css'
import '@/less/index.less'
document.querySelector('.login-btn').addEventListener('click',()=>{
  const username=document.querySelector('.username').value
  const password=document.querySelector('.password').value
  if(!checkUserName(username)) {return alert('用户名长度大于8位')}
  if(!checkPassWord(password)) {return alert('密码长度大于8位')}
  

console.log('用户名和密码长度符合要求')
axios({
  url: 'http://hmajax.itheima.net/api/register',
  method: 'POST',
  data: {
    username,
    password
  }
}).then(result => {
  alert(result.data.message)
}).catch(error => {
  alert(error.response.data.message)
})

})
document.querySelector('img').src = imgObj

const arr = [1, 2, 3]
const result = arr.map(val => val + 1)
console.log(result)

